<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>开心一下</title>
    <style>
        * {
            margin: 0;
            padding: 0;
        }

        .father {
            width: 500px;
            height: 300px;
            border: 1px solid #000;
            margin: 100px 100px;
        }

        h3 {
            height: 100px;
            font-size: 30px;
            line-height: 100px;
            text-indent: 2em;
        }

        h3 span {
            border: 1px solid blue;
            font-size: 20px;
            font-weight: normal;
            border-radius: 10px;
            cursor: pointer;
        }

        .son {
            height: 200px;
            font-size: 20px;
            text-indent: 2em;
        }
        a {
            display: inline-block;
            width: 100px;
            height: 50px;
            margin-left: 100px;
            line-height: 50px;
            font-size: 20px;
            color: skyblue;
            text-decoration: none;
            border: 1px solid pink;
        }
    </style>
</head>

<body>
    <div class="father">
        <h3>开心一笑- <span>换一个</span></h3>
        <div class="son"></div>
    </div>
    <a href="./html简历模板.html">个人简历</a>
    <script src="./jquery-1.12.4.js"></script>
    <script>
        $(function () {
            function fn() {
                $('.son').html('加载中...');
                $.ajax({
                    url: 'https://autumnfish.cn/api/joke',
                    success: function (backData) {
                        $('.son').html(backData);
                    }
                })
            };
            fn();
            $('span').on('click', function () {
                fn();
            })
        })
    </script>
</body>

</html>